In digital image processing, thresholding is one of the simplest methods of segmenting images. Basic thresholding methods replace each pixel in an image with a black pixel if the image intensity 'I' is less than some fixed constant 'T', or a white pixel if the image intensity is greater than that constant. In the example below, this results in the lower grayscale values becoming completely black, and higher grayscale values becoming completely white.
Original image (left) and after simple threshold applied (right)
Thresholding algorithms implemented in Dragonfly can be separated into the following categories:
Simple thresholding… For every pixel, the same threshold value is applied. If the pixel value is smaller than the threshold, it is set to 0, otherwise it is set to a maximum value.
Adaptive thresholding… In cases in which using a global value as a threshold might not be adequate, for example when working with images with varying illumination, adaptive thresholding can be applied. In this case, methods to adapt the threshold value on each pixel to the local image characteristics are applied. This results in a different threshold being selected for each pixel in the image. You should note that adaptive thresholding often requires more computation time than simple thresholding.
Computes a threshold mask image based on local pixel neighborhood, in which all pixels in the input image higher than the corresponding pixel in the threshold image are considered foreground. The threshold value is the weighted mean for the local neighborhood of a pixel subtracted by a constant. Alternatively the threshold can be determined dynamically by a given function, using the ‘generic’ method. The following parameters for adaptive thresholding are available:
Kernel… The size of the pixel neighborhood that is used to calculate the threshold value (e.g. 3, 5, 7, …, 33).
Method of thresholding… The method used to determine adaptive threshold for the local neighborhood in weighted mean image. Options include applying a Gaussian filter, arithmetic mean filter, or median rank filter. By default the ‘Gaussian’ method is used.
Offset… Constant subtracted from weighted mean of neighborhood to calculate the local threshold value. You should note that the default offset is 0.
References
Computes threshold value(s) based on the ISODATA method. That is, returned thresholds are intensities that separate the image into two groups of pixels, where the threshold intensity is midway between the mean intensities of these groups.
References
[1] Ridler, TW & Calvard, S (1978), “Picture thresholding using an iterative selection method”
[2] IEEE Transactions on Systems, Man and Cybernetics 8: 630-632, http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=4310039
[3] Sezgin M. and Sankur B. (2004) “Survey over Image Thresholding Techniques and Quantitative Performance Evaluation” Journal of Electronic Imaging, 13(1): 146-165, http://www.busim.ee.boun.edu.tr/~sankur/SankurFolder/Threshold_survey.pdf
Computes the threshold value based on an adaptation of Li’s Minimum Cross Entropy method.
References
[1] http://scikit-image.org/docs/dev/api/skimage.filters.html?highlight=adaptive%20filter#threshold-li
This filter an implementation of the Otsu thresholding technique and outputs an image composed of two basic classes — foreground and background. In this thresholding technique, the optimal value that minimizes the weighted within class variances of these two classes is computed. You should note that minimizing the within class variance is the same as maximizing the between class variance.
One of the main advantages of the Otsu thresholding technique is speed. However, the technique assumes uniform illumination and doesn’t use any object structure or spatial coherence. Since Otsu thresholding operates over histograms, you should analyze the image histogram before applying this filter (see Plotting Region Histograms).
References
Computes the threshold value based on Yen’s method.
References
[1] http://scikit-image.org/docs/dev/api/skimage.filters.html?highlight=adaptive%20filter#threshold-yen
[2] Yen J.C., Chang F.J., and Chang S. (1995) “A New Criterion for Automatic Multilevel Thresholding” IEEE Trans. on Image Processing, 4(3): 370-378
[3] Sezgin M. and Sankur B. (2004) “Survey over Image Thresholding Techniques and Quantitative Performance Evaluation” Journal of Electronic Imaging, 13(1): 146-165, http://www.busim.ee.boun.edu.tr/~sankur/SankurFolder/Threshold_survey.pdf